<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org" lang="en">

<head th:replace="fragments/headTag :: headTag">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Spreadsheet Template Builder App</title>

<!-- Bootstrap -->
<link
	href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.css"
	th:href="@{/webjars/bootstrap/3.0.3/css/bootstrap.css}"
	rel="stylesheet" />
<link href="../../../resources/css/navbar.css"
	th:href="@{/resources/css/navbar.css}" rel="stylesheet" />
<!-- JQuery -->
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"
	th:src="@{/webjars/jquery/1.9.0/jquery.min.js}"></script>
<script
	src="http://netdna.bootstrapcdn.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"
	th:src="@{/webjars/bootstrap/3.0.3/js/bootstrap.min.js}"></script>

<!-- Spring JS and Ajax -->
<script type="text/javascript" th:src="@{/resources/dojo/dojo.js}"></script>
<script type="text/javascript" th:src="@{/resources/spring/Spring.js}"></script>
<script type="text/javascript"
	th:src="@{/resources/spring/Spring-Dojo.js}"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>
<body>
	<div class="container">
		<div th:include="fragments/bodyHeader :: bodyHeader" th:remove="tag">This
			is the navigation bar here</div>
		<ol class="breadcrumb">
			<li th:text="#{breadcrumbs.template}">Template Selection</li>
			<li th:text="#{breadcrumbs.metadata}">Metadata Schema
				Configuration</li>
			<li th:text="#{breadcrumbs.metadataElements}">Metadata Elements
				Selection</li>
			<li class="active" th:text="#{breadcrumbs.review}">Review and
				Generate</li>
		</ol>
		<div class="panel panel-default">
			<div th:text="#{generate.upload.title}" class="panel-heading">Upload
				data ZIP File(s)</div>
			<div class="panel-body">
				<p th:text="#{generate.upload.text1}"></p>
				<form id="form-file" class="form-horizontal"
					th:action="${flowExecutionUrl}" method="post"
					enctype="multipart/form-data">
					<fieldset>
						<div id="error"
							th:if="${flowRequestContext.messageContext.hasErrorMessages()}">
							<h2>Errors</h2>
							<font
								th:each="message : ${flowRequestContext.messageContext.getMessagesBySource(files.file)}"
								color="red"><span th:text="${message}"></span></font>
						</div>
						<div class="form-group">
							<label class="col-md-4 control-label" for="fileselect"><span
								th:text="#{generate.upload.file.label}">Upload compressed
									File</span></label>
							<div class="col-md-4">
								<div class="input-group">
									<div class="input-group">
										<span class="input-group-btn"><span
											class="btn btn-primary btn-file"><span
												th:text="#{generate.upload.inputFile}">Browse&hellip;</span><input
												id="fileselect" type="file" name="file" class="form-control" />
										</span><input type="text" class="form-control" readonly="readonly" />
										</span>
									</div>
									<span th:text="#{upload.helpFiles}" class="help-block">
										Select the file(s) to upload</span>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-4 control-label" for="addFileBtn"><span
								th:text="#{generate.upload.file.label.add}">Upload</span></label>
							<div class="col-md-4">
								<div class="input-group">
									<input id="addFileBtn" name="_eventId_addFiles" type="submit"
										class="btn btn-primary" th:value="#{upload.button.add}" />
								</div>
							</div>
						</div>
					</fieldset>
					<p>
						<button name="_eventId_finish" type="submit"
							class="btn btn-primary" th:text="#{upload.button.finish}"></button>
						<button name="_eventId_cancelAdd"
							th:attr="data-content=#{upload.tooltip.cancel}"
							data-toggle="popover" type="submit" class="btn btn-danger"
							th:text="#{upload.button.cancel}"></button>
						<b>*</b>
					</p>
					<p>
						<b>* </b><span th:text="#{generate.upload.info}">It will
							delete all the uploaded files</span>
					</p>
				</form>
			</div>
		</div>
		<div class="modal js-loading-bar">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-body">
						<h4 th:text="#{upload.progressTitle}">Loading Schemas</h4>
						<div class="progress progress-striped active">
							<div class="progress-bar progress-bar-info" th:role="progressbar"
								th:aria-valuenow="100" th:aria-valuemin="0"
								th:aria-valuemax="100" style="width: 100%;"></div>
						</div>
						<span id="pbtext" class="hide" th:text="#{upload.pbMessage}">Uploading
							files...</span>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script>
		$(document)
				.ready(
						function() {
							/*Tooltips*/
							$('[data-toggle="tooltip"]').tooltip({
								'placement' : 'top'
							});

							$('[data-toggle="popover"]').popover({
								trigger : 'hover',
								'placement' : 'top'
							});

							$('.js-loading-bar').modal({
								backdrop : 'static',
								show : false
							});

							$('#addFileBtn')
									.click(
											function() {
												var $modal = $('.js-loading-bar'), $bar = $modal
														.find('.progress-bar');
												$modal.modal('show');
												$bar.text($('#pbtext').text());
												$bar.addClass('animate');
											});
						});
	</script>
</body>
</html>